package com.rt.cms.data.dto.system;

import com.rt.cms.common.Constants;
import com.rt.cms.common.utils.DateUtils;
import com.rt.cms.data.entity.system.User;
import freemarker.template.utility.DateUtil;

import java.util.Date;
import java.util.List;

public class UserDto {

    private Long id; //编号
    private Long organizationId; //所属公司
    private String username; //用户名
    private String roleIds; //拥有的角色列表
    private List<Long> roleIdList;
    private String locked;
    private String roleNames;
    private String organizationName;

    private String reallyName;

    private String phone;

    private String remarks;

    private String pName;

    private Date loginDate;

    private String createDate;

    private String updateDate;

    private String userType;

    private Long pId;


    public String getUserType() {
        return userType;
    }

    public void setUserType(String userType) {
        this.userType = userType;
    }

    public UserDto() {

    }

    public String getReallyName() {
        return reallyName;
    }

    public void setReallyName(String reallyName) {
        this.reallyName = reallyName;
    }

    public UserDto(User user) {
        this.id = user.getId();
        this.organizationId = user.getOrganizationId();
        this.username = user.getUsername();
        this.roleIds = user.getRoleIds();
        this.roleIdList = user.getRoleIdList();
        this.locked = user.getLocked() == false ? Constants.UNLOCKED : Constants.LOCKED;
        this.reallyName = user.getReallyName();
        this.phone = user.getPhone();
        this.remarks = user.getRemarks();
        this.createDate = user.getCreateDate() == null ? null: DateUtils.formatDate(user.getCreateDate());
        this.updateDate = user.getUpdateDate() == null ? null: DateUtils.formatDate(user.getUpdateDate());
        this.userType = user.getUserType();
        this.organizationName = user.getOrganizationName();
        this.pId = user.getpId();

    }

    public Long getpId() {
        return pId;
    }


    public void setpId(Long pId) {
        this.pId = pId;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getOrganizationId() {
        return organizationId;
    }

    public void setOrganizationId(Long organizationId) {
        this.organizationId = organizationId;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getRoleIds() {
        return roleIds;
    }

    public void setRoleIds(String roleIds) {
        this.roleIds = roleIds;
    }

    public List<Long> getRoleIdList() {
        return roleIdList;
    }

    public void setRoleIdList(List<Long> roleIdList) {
        this.roleIdList = roleIdList;
    }

    public String getLocked() {
        return locked;
    }

    public void setLocked(String locked) {
        this.locked = locked;
    }

    public String getRoleNames() {
        return roleNames;
    }

    public void setRoleNames(String roleNames) {
        this.roleNames = roleNames;
    }

    public String getOrganizationName() {
        return organizationName;
    }

    public void setOrganizationName(String organizationName) {
        this.organizationName = organizationName;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    public String getpName() {
        return pName;
    }

    public void setpName(String pName) {
        this.pName = pName;
    }

    public Date getLoginDate() {
        return loginDate;
    }

    public void setLoginDate(Date loginDate) {
        this.loginDate = loginDate;
    }

    public String getCreateDate() {
        return createDate;
    }

    public void setCreateDate(String createDate) {
        this.createDate = createDate;
    }

    public String getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(String updateDate) {
        this.updateDate = updateDate;
    }
}
